\ProvidesPackage{beamerthemesimula}

% A stripped down theme for Simula

\mode<presentation>

\institute{CBC}

% Use the simula outer-theme; this defines some sizes and set up the standard
% slidestyle with the Simula footer. It also set the footer with swoosh as
% default for the first page, the simulatitlepage command turns this one off
% again for subsequent slides. This must be done manually if a regular
% titlepage command is used.
\useoutertheme{cbc}

% Use the simula inner-theme; this defines rounded blocks, turn off shadows,
% defines the titlepage and the partpages.
\useinnertheme{cbc}

\usefonttheme[onlysmall]{structurebold}
% ensure the Simula font-style (basically, it turns on bold for a few fields)
\usefonttheme{simula}


% This is not created yet, but should be...
%\usecolortheme{simula}

% Suppress navigation symbols
\setbeamertemplate{navigation symbols}{}

%\definecolor{simulaorange}{rgb}{1.0,0.53,0.0}
%\definecolor{simulaorange2}{rgb}{1.0,0.6,0.0}
%\definecolor{simulaorange3}{rgb}{1.0,0.4,0.0}
%\definecolor{simulaorange4}{rgb}{1.0,0.2667,0.0}
\definecolor{cbcred}{rgb}{0.65,0.098,0.19}

\setbeamercolor{simula}{fg=white,bg=cbcred}
\setbeamercolor{title}{fg=cbcred,bg=}
\setbeamercolor{frametitle}{fg=black!65!white,bg=white}
\setbeamercolor{normal text}{fg=black!75!white,bg=white}
\setbeamercolor{structure}{fg=black,bg=white}
\setbeamercolor{itemize item}{fg=cbcred}
\setbeamercolor{frametitle}{fg=cbcred}


% Define a global default for @usetwocolumns
\global\let\@usetwocolumns\@empty

% Turn on the swoosh-background
\newcommand{\turnonBackground}{%
\setbeamertemplate{background canvas}{
% we want the footer at the bottom, so we use a phantom ruler
\color{green}\vrule width 0cm height\paperheight%
\includegraphics[width=\paperwidth]{cbc_footer}%
}
}

% Turn off the swoosh-background
\newcommand{\turnoffBackground}{%
\usebackgroundtemplate{}%
}

% Definition of Simla title page. Should have the swoosh background, but we
% don't force that - if use turns off background immediately, the swoosh wil be
% gone.
% The simulatitlepage accept the [twocolumn] option - in this case text goes to
% the left and a picture to the right, in a 2/3 ratio. The ratio should be
% customizeable in the future.
\newcommand{\simulatitlepage}[1][]{%
\def\@usetwocolumns{#1}%
\begin{frame}[plain]%
\ifx\@usetwocolumns\@empty%
{\titlepage%
\begin{centering}%
{\usebeamercolor[fg]{titlegraphic}\inserttitlegraphic\par}%
\end{centering}%
}%
\else%
{%
\begin{columns}%
\column{0.6\textwidth}%
\titlepage%
\column{0.4\textwidth}
{\usebeamercolor[fg]{titlegraphic}\inserttitlegraphic\par}%
\end{columns}%
}%
\fi%
\end{frame}%
\turnoffBackground%
}

% Set a backgroud image
\newcommand\BackgroundPicture[1]{%
  \setbeamertemplate{background}{%
   \parbox[c][\paperheight]{\paperwidth}{%
   \vfill \hfill
   \includegraphics[width=1\paperwidth,height=1\paperheight]{#1}
   \hfill \vfill
}}}

% Turn background picture off
\newcommand\BackgroundPictureOff{%
   \setbeamertemplate{background}{\relax}
}


% Not sure about this one, it was in the one I tweaked. Should test.
\setbeamerfont{block title}{size={}}

%Setting the following to anything (true,false,foo,bar) turns on pagenumbering
%TODO: make this an option somewhere...
\def\@pagenumbering{}
\mode
<all>
